package com.iflytek.jobs.app;

import com.iflytek.jobs.service.domain.JobInfo;
import com.iflytek.jobs.service.service.IJobInfoService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/app/jobinfo")
public class AppJobInfoController extends BaseController {

    @Autowired
    private IJobInfoService jobInfoService;

    /**
     * 查询岗位信息列表
     */
    @GetMapping("/list")
    public TableDataInfo list(JobInfo jobInfo)
    {
        startPage();
        List<JobInfo> list = jobInfoService.selectJobInfoList(jobInfo);
        return getDataTable(list);
    }

    /**
     * 获取岗位信息详细信息
     */
    @GetMapping(value = "/{jobId}")
    public AjaxResult getInfo(@PathVariable("jobId") String jobId)
    {
        return success(jobInfoService.selectJobInfoByJobId(jobId));
    }

}
